home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Dictionary.a < prev    next >
Text File  |  1996-05-01  |  28KB  |  959 lines

  1. ;
  2. ;    File:        Dictionary.a
  3. ;
  4. ;    Contains:    Dictionary Manager Interfaces
  5. ;
  6. ;    Version:    Technology:    System 8
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__DICTIONARY__') = 'UNDEFINED' THEN
  19. __DICTIONARY__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  25.     IF &TYPE('__AEDATAMODEL__') = 'UNDEFINED' THEN
  26.     include 'AEDataModel.a'
  27.     ENDIF
  28.     IF &TYPE('__AEREGISTRY__') = 'UNDEFINED' THEN
  29.     include 'AERegistry.a'
  30.     ENDIF
  31.     IF &TYPE('__FILEMANAGERTYPES__') = 'UNDEFINED' THEN
  32.     include 'FileManagerTypes.a'
  33.     ENDIF
  34.     ENDIF
  35.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  36.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  37.     include 'Files.a'
  38.     ENDIF
  39.     ENDIF
  40. ;
  41. ;=============================================================================================
  42. ; System 8 Dictionary Manager
  43. ;=============================================================================================
  44. ;
  45.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  46. ; typedef UInt32                         DCMUniqueID
  47.  
  48.     IF FOR_PTR_BASED_AE THEN
  49. DCMFieldDataList        RECORD 0
  50. f                         ds        AERecord
  51. sizeof                     EQU *                    ; size:   $8 (8)
  52.                         ENDR
  53.  
  54.  
  55.     ENDIF
  56.  
  57.  
  58. ; typedef DCMObjectID                     DCMAccessMethodID
  59.  
  60. ; typedef DCMObjectID                     DCMDictionaryID
  61.  
  62.  
  63. kDCMInvalidObjectID                EQU        0
  64.  
  65.  
  66. ; typedef DCMObjectRef                     DCMDictionaryRef
  67.  
  68. ; typedef DCMObjectRef                     DCMDictionaryStreamRef
  69.  
  70. ; typedef DCMObjectRef                     DCMFieldInfoRef
  71.  
  72.  
  73. kDCMInvalidObjectRef            EQU        0
  74.  
  75.  
  76. ; typedef DCMObjectIterator             DCMAccessMethodIterator
  77.  
  78. ; typedef DCMObjectIterator             DCMDictionaryIterator
  79.  
  80.  
  81.  
  82. ;
  83. ;    Field specification declarations
  84. ;
  85. ; typedef FourCharCode                     DCMFieldTag
  86.  
  87. ; typedef FourCharCode                     DCMFieldType
  88.  
  89. DCMFieldSubType            RECORD 0
  90. f                         ds        UInt64
  91. sizeof                     EQU *                    ; size:   $8 (8)
  92.                         ENDR
  93.  
  94.  
  95.  
  96. kDCMAnyFieldTag                    EQU        '****'
  97. kDCMAnyFieldType                EQU        '****'
  98. ;
  99. ;    Dictionary information
  100. ;
  101.  
  102. kDCMDictionaryHeaderVersion        EQU        1
  103. DCMDictionaryHeader        RECORD 0
  104. headerSignature             ds.l    1                ; offset: $0 (0)
  105. headerVersion             ds.l    1                ; offset: $4 (4)
  106. headerSize                 ds.l    1                ; offset: $8 (8)
  107. accessMethod             ds        Str63            ; offset: $C (12)
  108. sizeof                     EQU *                    ; size:   $4C (76)
  109.                         ENDR
  110. ; typedef OptionBits                     DCMFieldAttribute
  111.  
  112.  
  113. kDCMIndexedFieldMask            EQU        $00000001
  114. kDCMRequiredFieldMask            EQU        $00000002
  115. kDCMIdentifyFieldMask            EQU        $00000004
  116. kDCMFixedSizeFieldMask            EQU        $00000008
  117. kDCMHiddenFieldMask                EQU        $80000000
  118. ;
  119. ;    Standard dictionary properties
  120. ;
  121.  
  122.                                                             ; created/updated by AccessMethod.
  123.                                                             ; data type: typeSInt16
  124. kDCMPermissionPropertyTag        EQU        'perm'                ; created/updated by AccessMethod.
  125.                                                             ; data type: typeSInt16
  126. kDCMMaintenancePropertyTag        EQU        'mtnc'                ; created by AccessMethod. default = kLocaleIdentifierWildCard.
  127.                                                             ; data type: typeUInt32
  128. kDCMLocalePropertyTag            EQU        'locl'                ; optional.
  129.                                                             ; data type: typeType
  130. kDCMClassPropertyTag            EQU        'clas'                ; optional.
  131.                                                             ; data type: typeChar (ASCII string)
  132. kDCMCopyrightPropertyTag        EQU        'info'
  133. ;
  134. ;    'perm' property constants
  135. ;
  136.  
  137. kDCMReadOnlyDictionary            EQU        0
  138. kDCMReadWriteDictionary            EQU        1
  139. kDCMFrozenDictionary            EQU        2
  140. ;
  141. ;    Standard search method
  142. ;
  143. ; typedef OSType                         DCMFindMethodType
  144.  
  145.  
  146. kDCMExactMatchMethod            EQU        '=   '
  147. kDCMBeginningMatchMethod        EQU        'bgwt'
  148. kDCMContainsMatchMethod            EQU        'cont'
  149. kDCMEndingMatchMethod            EQU        'ends'
  150. kDCMForwardTrieMethod            EQU        'ftri'                ; used for morphological analysis
  151. kDCMBackwardTrieMethod            EQU        'btri'                ; used for morphological analysis
  152. ;
  153. ;    AccessMethod features
  154. ;
  155. ; typedef OptionBits                     DCMAccessMethodFeature
  156.  
  157.  
  158. kDCMCanUseFileDictionaryMask    EQU        $00000001
  159. kDCMCanUseMemoryDictionaryMask    EQU        $00000002
  160. kDCMCanStreamDictionaryMask        EQU        $00000004
  161. kDCMCanHaveMultipleIndexMask    EQU        $00000008
  162. kDCMCanModifyDictionaryMask        EQU        $00000010
  163. kDCMCanCreateDictionaryMask        EQU        $00000020
  164. kDCMCanAddDictionaryFieldMask    EQU        $00000040
  165. kDCMCanUseTransactionMask        EQU        $00000080
  166. ;
  167. ;    Error values
  168. ;
  169.  
  170. dcmParamErr                        EQU        -7100                ; bad parameter
  171. dcmNotDictionaryErr                EQU        -7101                ; not dictionary
  172. dcmBadDictionaryErr                EQU        -7102                ; invalid dictionary
  173. dcmPermissionErr                EQU        -7103                ; invalid permission
  174. dcmDictionaryNotOpenErr            EQU        -7104                ; dictionary not opened
  175. dcmDictionaryBusyErr            EQU        -7105                ; dictionary is busy
  176. dcmBadDictionaryTypeErr            EQU        -7106                ; bad dictionary type
  177. dcmBlockFullErr                    EQU        -7107                ; dictionary block full
  178. dcmNoRecordErr                    EQU        -7108                ; no such record
  179. dcmDupRecordErr                    EQU        -7109                ; same record already exist
  180. dcmNecessaryFieldErr            EQU        -7110                ; lack required/identify field
  181. dcmBadFieldInfoErr                EQU        -7111                ; incomplete information
  182. dcmBadFieldTypeErr                EQU        -7112                ; no such field type supported
  183. dcmNoFieldErr                    EQU        -7113                ; no such field exist
  184. dcmDupFieldErr                    EQU        -7114                ; field already exist
  185. dcmBadKeyErr                    EQU        -7115                ; bad key information
  186. dcmTooManyKeyErr                EQU        -7116                ; too many key field
  187. dcmBadDataSizeErr                EQU        -7117                ; too big data size
  188. dcmBadFindMethodErr                EQU        -7118                ; no such find method supported
  189. dcmBadPropertyErr                EQU        -7119                ; no such property exist
  190. dcmEndOfStreamErr                EQU        -7120                ; reaches end of stream
  191. dcmProtectedErr                    EQU        -7121                ; need keyword to use dictionary
  192. dcmNoAccessMethodErr            EQU        -7122                ; no such AccessMethod
  193. dcmDupAccessMethodErr            EQU        -7123                ; AccessMethod already exist
  194. dcmBadFeatureErr                EQU        -7124                ; invalid AccessMethod feature
  195. dcmAccessMethodBusyErr            EQU        -7125                ; AccessMethod is busy
  196. dcmIterationCompleteErr            EQU        -7126                ; no more item in iterator
  197. dcmBufferOverflowErr            EQU        -7127                ; data is larger than buffer size
  198. dcmChangesCommittedErr            EQU        -7128                ; changes cannot be backed out
  199. ;
  200. ;    Callback routines
  201. ;
  202. ;
  203. ;    Create dictionary
  204. ;
  205. ;
  206. ; extern OSStatus DCMNewDictionary(DCMAccessMethodID accessMethod, FSObjectRef containerRef, ConstFSName dictionaryName, ItemCount numOfField, const DCMFieldInfoRef field[2147483647], Boolean invisible, ItemCount recordCapacity, DCMDictionaryID *newDictionary)
  207. ;
  208.     IF GENERATINGCFM THEN
  209.         IMPORT_CFM_FUNCTION DCMNewDictionary
  210.     ENDIF
  211.  
  212. ;
  213. ; extern OSStatus DCMDeriveNewDictionary(DCMDictionaryID srcDictionary, FSObjectRef containerRef, ConstFSName dictionaryName, Boolean invisible, ItemCount recordCapacity, DCMDictionaryID *newDictionary)
  214. ;
  215.     IF GENERATINGCFM THEN
  216.         IMPORT_CFM_FUNCTION DCMDeriveNewDictionary
  217.     ENDIF
  218.  
  219. ;
  220. ;    Register dictionary
  221. ;
  222. ;
  223. ; extern OSStatus DCMRegisterDictionaryFile(FSObjectRef dictionaryFile, DCMDictionaryID *dictionaryID)
  224. ;
  225.     IF GENERATINGCFM THEN
  226.         IMPORT_CFM_FUNCTION DCMRegisterDictionaryFile
  227.     ENDIF
  228.  
  229. ;
  230. ; extern OSStatus DCMRegisterDictionaryStream(DCMRegisterStreamProc myRegisterProc, void *refcon, ByteCount dictionarySize, DCMDictionaryID *dictionaryID)
  231. ;
  232.     IF GENERATINGCFM THEN
  233.         IMPORT_CFM_FUNCTION DCMRegisterDictionaryStream
  234.     ENDIF
  235.  
  236. ;
  237. ; extern OSStatus DCMUnregisterDictionary(DCMDictionaryID dictionaryID)
  238. ;
  239.     IF GENERATINGCFM THEN
  240.         IMPORT_CFM_FUNCTION DCMUnregisterDictionary
  241.     ENDIF
  242.  
  243. ;
  244. ;    Open dictionary
  245. ;
  246. ;
  247. ; extern OSStatus DCMOpenDictionary(DCMDictionaryID dictionaryID, ByteCount protectKeySize, LogicalAddress protectKey, DCMDictionaryRef *dictionaryRef)
  248. ;
  249.     IF GENERATINGCFM THEN
  250.         IMPORT_CFM_FUNCTION DCMOpenDictionary
  251.     ENDIF
  252.  
  253. ;
  254. ; extern OSStatus DCMCloseDictionary(DCMDictionaryRef dictionaryRef)
  255. ;
  256.     IF GENERATINGCFM THEN
  257.         IMPORT_CFM_FUNCTION DCMCloseDictionary
  258.     ENDIF
  259.  
  260. ;
  261. ;    Change access privilege
  262. ;
  263. ;
  264. ; extern OSStatus DCMGetDictionaryWriteAccess(DCMDictionaryRef dictionaryRef, Duration timeOutDuration)
  265. ;
  266.     IF GENERATINGCFM THEN
  267.         IMPORT_CFM_FUNCTION DCMGetDictionaryWriteAccess
  268.     ENDIF
  269.  
  270. ;
  271. ; extern OSStatus DCMReleaseDictionaryWriteAccess(DCMDictionaryRef dictionaryRef, Boolean commitTransaction)
  272. ;
  273.     IF GENERATINGCFM THEN
  274.         IMPORT_CFM_FUNCTION DCMReleaseDictionaryWriteAccess
  275.     ENDIF
  276.  
  277. ;
  278. ;    Find records
  279. ;
  280. ;
  281. ; extern OSStatus DCMFindRecords(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMFindMethodType findMethod, ItemCount preFetchedDataNum, DCMFieldTag preFetchedData[2147483647], ItemCount skipCount, ItemCount maxRecordCount, DCMFoundRecordIterator *recordIterator)
  282. ;
  283.     IF GENERATINGCFM THEN
  284.         IMPORT_CFM_FUNCTION DCMFindRecords
  285.     ENDIF
  286.  
  287. ;
  288. ; extern ItemCount DCMCountRecordIterator(DCMFoundRecordIterator recordIterator)
  289. ;
  290.     IF GENERATINGCFM THEN
  291.         IMPORT_CFM_FUNCTION DCMCountRecordIterator
  292.     ENDIF
  293.  
  294.     IF FOR_PTR_BASED_AE THEN
  295. ;
  296. ; extern OSStatus DCMIterateFoundRecord(DCMFoundRecordIterator recordIterator, ByteCount maxKeySize, ByteCount *actualKeySize, LogicalAddress keyData, DCMUniqueID *uniqueID, DCMFieldDataList *dataList)
  297. ;
  298.     IF GENERATINGCFM THEN
  299.         IMPORT_CFM_FUNCTION DCMIterateFoundRecord
  300.     ENDIF
  301.  
  302.     ENDIF
  303. ;
  304. ; extern OSStatus DCMDisposeRecordIterator(DCMFoundRecordIterator recordIterator)
  305. ;
  306.     IF GENERATINGCFM THEN
  307.         IMPORT_CFM_FUNCTION DCMDisposeRecordIterator
  308.     ENDIF
  309.  
  310. ;
  311. ;    Dump dictionary
  312. ;
  313. ;
  314. ; extern OSStatus DCMGetNextRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ByteCount maxKeySize, ByteCount *nextKeySize, LogicalAddress nextKeyData, DCMUniqueID *nextUniqueID)
  315. ;
  316.     IF GENERATINGCFM THEN
  317.         IMPORT_CFM_FUNCTION DCMGetNextRecord
  318.     ENDIF
  319.  
  320. ;
  321. ; extern OSStatus DCMGetPrevRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ByteCount maxKeySize, ByteCount *prevKeySize, LogicalAddress prevKeyData, DCMUniqueID *prevUniqueID)
  322. ;
  323.     IF GENERATINGCFM THEN
  324.         IMPORT_CFM_FUNCTION DCMGetPrevRecord
  325.     ENDIF
  326.  
  327. ;
  328. ; extern OSStatus DCMGetNthRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ItemCount serialNum, ByteCount maxKeySize, ByteCount *keySize, LogicalAddress keyData, DCMUniqueID *uniqueID)
  329. ;
  330.     IF GENERATINGCFM THEN
  331.         IMPORT_CFM_FUNCTION DCMGetNthRecord
  332.     ENDIF
  333.  
  334. ;
  335. ; extern OSStatus DCMGetRecordSequenceNumber(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ItemCount *sequenceNum)
  336. ;
  337.     IF GENERATINGCFM THEN
  338.         IMPORT_CFM_FUNCTION DCMGetRecordSequenceNumber
  339.     ENDIF
  340.  
  341. ;
  342. ;    Get field data
  343. ;
  344.     IF FOR_PTR_BASED_AE THEN
  345. ;
  346. ; extern OSStatus DCMGetFieldData(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ItemCount numOfData, const DCMFieldTag dataTag[2147483647], DCMFieldDataList *dataList)
  347. ;
  348.     IF GENERATINGCFM THEN
  349.         IMPORT_CFM_FUNCTION DCMGetFieldData
  350.     ENDIF
  351.  
  352. ;
  353. ; extern OSStatus DCMSetFieldData(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, DCMFieldDataList dataList)
  354. ;
  355.     IF GENERATINGCFM THEN
  356.         IMPORT_CFM_FUNCTION DCMSetFieldData
  357.     ENDIF
  358.  
  359.     ENDIF
  360. ;
  361. ; extern OSStatus DCMAnnotateTextObjectWithFieldData(DCMDictionaryRef dictionaryRef, DCMFieldTag keyTag, DCMUniqueID uniqueID, ItemCount numDataField, const DCMFieldTag data[2147483647], TextObject keyText)
  362. ;
  363.     IF GENERATINGCFM THEN
  364.         IMPORT_CFM_FUNCTION DCMAnnotateTextObjectWithFieldData
  365.     ENDIF
  366.  
  367. ;
  368. ;    Add record
  369. ;
  370.     IF FOR_PTR_BASED_AE THEN
  371. ;
  372. ; extern OSStatus DCMAddRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, Boolean checkOnly, DCMFieldDataList dataList, DCMUniqueID *newUniqueID)
  373. ;
  374.     IF GENERATINGCFM THEN
  375.         IMPORT_CFM_FUNCTION DCMAddRecord
  376.     ENDIF
  377.  
  378.     ENDIF
  379. ;
  380. ; extern OSStatus DCMDeleteRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID)
  381. ;
  382.     IF GENERATINGCFM THEN
  383.         IMPORT_CFM_FUNCTION DCMDeleteRecord
  384.     ENDIF
  385.  
  386. ;
  387. ; extern OSStatus DCMCopyRecord(DCMDictionaryRef srcDictionary, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, DCMDictionaryRef targetDictionary, Boolean checkOnly, DCMUniqueID *newUniqueID)
  388. ;
  389.     IF GENERATINGCFM THEN
  390.         IMPORT_CFM_FUNCTION DCMCopyRecord
  391.     ENDIF
  392.  
  393. ;
  394. ;    Add field
  395. ;
  396. ;
  397. ; extern OSStatus DCMAddField(DCMDictionaryID dictionaryID, DCMFieldInfoRef fieldInfo, DCMProgressProc progressProcPtr, void *procRefcon)
  398. ;
  399.     IF GENERATINGCFM THEN
  400.         IMPORT_CFM_FUNCTION DCMAddField
  401.     ENDIF
  402.  
  403. ;
  404. ; extern OSStatus DCMDeleteField(DCMDictionaryID dictionaryID, DCMFieldTag fieldTag, DCMProgressProc progressProcPtr, void *procRefcon)
  405. ;
  406.     IF GENERATINGCFM THEN
  407.         IMPORT_CFM_FUNCTION DCMDeleteField
  408.     ENDIF
  409.  
  410. ;
  411. ;    Get dictionary information
  412. ;
  413. ;
  414. ; extern OSStatus DCMCountRecord(DCMDictionaryID dictionaryID, ItemCount *count)
  415. ;
  416.     IF GENERATINGCFM THEN
  417.         IMPORT_CFM_FUNCTION DCMCountRecord
  418.     ENDIF
  419.  
  420. ;
  421. ; extern OSStatus DCMGetDictionaryInformarion(DCMDictionaryID dictionaryID, DCMAccessMethodID *accessMethod, Boolean *isProtected)
  422. ;
  423.     IF GENERATINGCFM THEN
  424.         IMPORT_CFM_FUNCTION DCMGetDictionaryInformarion
  425.     ENDIF
  426.  
  427. ;
  428. ; extern OSStatus DCMGetDictionaryFieldList(DCMDictionaryID dictionaryID, ItemCount maxFieldNum, ItemCount *actualFieldNum, DCMFieldTag fieldTag[2147483647], DCMFieldType fieldType[2147483647])
  429. ;
  430.     IF GENERATINGCFM THEN
  431.         IMPORT_CFM_FUNCTION DCMGetDictionaryFieldList
  432.     ENDIF
  433.  
  434. ;
  435. ; extern OSStatus DCMGetDictionaryFieldInfo(DCMDictionaryID dictionaryID, DCMFieldTag fieldTag, DCMFieldInfoRef fieldInfo)
  436. ;
  437.     IF GENERATINGCFM THEN
  438.         IMPORT_CFM_FUNCTION DCMGetDictionaryFieldInfo
  439.     ENDIF
  440.  
  441. ;
  442. ; extern OSStatus DCMGetFileRefFromDictionaryID(DCMDictionaryID dictionaryID, FSObjectRef *fileRef)
  443. ;
  444.     IF GENERATINGCFM THEN
  445.         IMPORT_CFM_FUNCTION DCMGetFileRefFromDictionaryID
  446.     ENDIF
  447.  
  448. ;
  449. ; extern OSStatus DCMGetDictionaryIDFromFile(FSObjectRef fileRef, DCMDictionaryID *dictionaryID)
  450. ;
  451.     IF GENERATINGCFM THEN
  452.         IMPORT_CFM_FUNCTION DCMGetDictionaryIDFromFile
  453.     ENDIF
  454.  
  455. ;
  456. ; extern DCMDictionaryID DCMGetDictionaryIDFromRef(DCMDictionaryRef dictionaryRef)
  457. ;
  458.     IF GENERATINGCFM THEN
  459.         IMPORT_CFM_FUNCTION DCMGetDictionaryIDFromRef
  460.     ENDIF
  461.  
  462. ;
  463. ; extern UInt32 DCMGetDictionaryChangeCount(DCMDictionaryID dictionaryID)
  464. ;
  465.     IF GENERATINGCFM THEN
  466.         IMPORT_CFM_FUNCTION DCMGetDictionaryChangeCount
  467.     ENDIF
  468.  
  469. ;
  470. ;    Dictionary property
  471. ;
  472. ;
  473. ; extern OSStatus DCMGetDictionaryProperty(DCMDictionaryID dictionaryID, DCMFieldTag propertyTag, ByteCount maxPropertySize, ByteCount *actualSize, LogicalAddress propertyValue)
  474. ;
  475.     IF GENERATINGCFM THEN
  476.         IMPORT_CFM_FUNCTION DCMGetDictionaryProperty
  477.     ENDIF
  478.  
  479. ;
  480. ; extern OSStatus DCMSetDictionaryProperty(DCMDictionaryID dictionaryID, DCMFieldTag propertyTag, ByteCount propertySize, ConstLogicalAddress propertyValue)
  481. ;
  482.     IF GENERATINGCFM THEN
  483.         IMPORT_CFM_FUNCTION DCMSetDictionaryProperty
  484.     ENDIF
  485.  
  486. ;
  487. ; extern OSStatus DCMGetDictionaryPropertyList(DCMDictionaryID dictionaryID, ItemCount maxPropertyNum, ItemCount *numProperties, DCMFieldTag propertyTag[2147483647])
  488. ;
  489.     IF GENERATINGCFM THEN
  490.         IMPORT_CFM_FUNCTION DCMGetDictionaryPropertyList
  491.     ENDIF
  492.  
  493. ;
  494. ;    Get dictionary stream
  495. ;
  496. ;
  497. ; extern OSStatus DCMCreateDictionaryStream(DCMDictionaryID dictionaryID, DCMDictionaryStreamRef *stream)
  498. ;
  499.     IF GENERATINGCFM THEN
  500.         IMPORT_CFM_FUNCTION DCMCreateDictionaryStream
  501.     ENDIF
  502.  
  503. ;
  504. ; extern OSStatus DCMReadDictionaryStream(DCMDictionaryStreamRef stream, ByteCount maxSize, ByteCount *actualSize, LogicalAddress buffer)
  505. ;
  506.     IF GENERATINGCFM THEN
  507.         IMPORT_CFM_FUNCTION DCMReadDictionaryStream
  508.     ENDIF
  509.  
  510. ;
  511. ; extern OSStatus DCMDisposeDictionaryStream(DCMDictionaryStreamRef stream)
  512. ;
  513.     IF GENERATINGCFM THEN
  514.         IMPORT_CFM_FUNCTION DCMDisposeDictionaryStream
  515.     ENDIF
  516.  
  517. ;
  518. ;    Reorganize/compact dictionary
  519. ;
  520. ;
  521. ; extern OSStatus DCMReorganizeDictionary(DCMDictionaryID dictionaryID, ItemCount extraCapacity, DCMProgressProc progressProcPtr, void *procRefcon)
  522. ;
  523.     IF GENERATINGCFM THEN
  524.         IMPORT_CFM_FUNCTION DCMReorganizeDictionary
  525.     ENDIF
  526.  
  527. ;
  528. ; extern OSStatus DCMFreezeDictionary(DCMDictionaryID dictionaryID, DCMProgressProc progressProcPtr, void *procRefcon)
  529. ;
  530.     IF GENERATINGCFM THEN
  531.         IMPORT_CFM_FUNCTION DCMFreezeDictionary
  532.     ENDIF
  533.  
  534. ;
  535. ; extern OSStatus DCMUnfreezeDictionary(DCMDictionaryID dictionaryID, ItemCount extraCapacity, DCMProgressProc progressProcPtr, void *procRefcon)
  536. ;
  537.     IF GENERATINGCFM THEN
  538.         IMPORT_CFM_FUNCTION DCMUnfreezeDictionary
  539.     ENDIF
  540.  
  541. ;
  542. ;    Seaarch dictionary
  543. ;
  544. ;
  545. ; extern OSStatus DCMCreateDictionaryIterator(DCMDictionaryIterator *dictionaryIterator)
  546. ;
  547.     IF GENERATINGCFM THEN
  548.         IMPORT_CFM_FUNCTION DCMCreateDictionaryIterator
  549.     ENDIF
  550.  
  551. ;
  552. ; extern OSStatus DCMFindDictionaryByField(DCMFieldTag desiredTag, DCMFieldType desiredType, DCMFieldAttribute attributeMask, ItemCount numOfFindMethod, const DCMFindMethodType neededMethods[2147483647], ByteCount requiredFieldSize, Boolean dataTypeTranslation, Boolean writeFieldData, Boolean findProtected, DCMDictionaryIterator dictionaryIterator)
  553. ;
  554.     IF GENERATINGCFM THEN
  555.         IMPORT_CFM_FUNCTION DCMFindDictionaryByField
  556.     ENDIF
  557.  
  558. ;
  559. ; extern OSStatus DCMFindDictionaryByProperty(DCMFieldTag propertyTag, ByteCount propertySize, ConstLogicalAddress propertyValue, DCMDictionaryIterator dictionaryIterator)
  560. ;
  561.     IF GENERATINGCFM THEN
  562.         IMPORT_CFM_FUNCTION DCMFindDictionaryByProperty
  563.     ENDIF
  564.  
  565. ;
  566. ;    Search AccessMethod
  567. ;
  568. ;
  569. ; extern OSStatus DCMCreateAccessMethodIterator(DCMAccessMethodIterator *accessMethodIterator)
  570. ;
  571.     IF GENERATINGCFM THEN
  572.         IMPORT_CFM_FUNCTION DCMCreateAccessMethodIterator
  573.     ENDIF
  574.  
  575. ;
  576. ; extern OSStatus DCMFindAccessMethodByField(DCMFieldType fieldType, Boolean keyField, ItemCount numOfFindMethod, const DCMFindMethodType neededMethods[2147483647], ByteCount requiredSize, Boolean dataTypeTranslation, DCMAccessMethodIterator accessMethodIterator)
  577. ;
  578.     IF GENERATINGCFM THEN
  579.         IMPORT_CFM_FUNCTION DCMFindAccessMethodByField
  580.     ENDIF
  581.  
  582. ;
  583. ; extern OSStatus DCMFindAccessMethodByFeature(DCMAccessMethodFeature neededFeature, DCMAccessMethodIterator accessMethodIterator)
  584. ;
  585.     IF GENERATINGCFM THEN
  586.         IMPORT_CFM_FUNCTION DCMFindAccessMethodByFeature
  587.     ENDIF
  588.  
  589. ;
  590. ;    Iterator Operation
  591. ;
  592. ;
  593. ; extern ItemCount DCMCountObjectIterator(DCMObjectIterator iterator)
  594. ;
  595.     IF GENERATINGCFM THEN
  596.         IMPORT_CFM_FUNCTION DCMCountObjectIterator
  597.     ENDIF
  598.  
  599. ;
  600. ; extern OSStatus DCMIterateObject(DCMObjectIterator iterator, DCMObjectID *objectID)
  601. ;
  602.     IF GENERATINGCFM THEN
  603.         IMPORT_CFM_FUNCTION DCMIterateObject
  604.     ENDIF
  605.  
  606. ;
  607. ; extern OSStatus DCMResetObjectIterator(DCMObjectIterator iterator)
  608. ;
  609.     IF GENERATINGCFM THEN
  610.         IMPORT_CFM_FUNCTION DCMResetObjectIterator
  611.     ENDIF
  612.  
  613. ;
  614. ; extern OSStatus DCMDisposeObjectIterator(DCMObjectIterator iterator)
  615. ;
  616.     IF GENERATINGCFM THEN
  617.         IMPORT_CFM_FUNCTION DCMDisposeObjectIterator
  618.     ENDIF
  619.  
  620. ;
  621. ;    Register AccessMethod
  622. ;
  623. ;
  624. ; extern OSStatus DCMRegisterAccessMethod(FSObjectRef accessMethodFile, ItemCount maxAccessMethodNum, ItemCount *accessMethodNum, DCMAccessMethodID accessMethod[2147483647])
  625. ;
  626.     IF GENERATINGCFM THEN
  627.         IMPORT_CFM_FUNCTION DCMRegisterAccessMethod
  628.     ENDIF
  629.  
  630. ;
  631. ; extern OSStatus DCMUnregisterAccessMethod(DCMAccessMethodID accessMethod)
  632. ;
  633.     IF GENERATINGCFM THEN
  634.         IMPORT_CFM_FUNCTION DCMUnregisterAccessMethod
  635.     ENDIF
  636.  
  637. ;
  638. ;    Get AccessMethod information
  639. ;
  640. ;
  641. ; extern OSStatus DCMGetAccessMethodInformation(DCMAccessMethodID accessMethod, ByteCount maxNameLen, ByteCount *nameLength, LogicalAddress libraryName, UInt32 *version, DCMAccessMethodFeature *feature)
  642. ;
  643.     IF GENERATINGCFM THEN
  644.         IMPORT_CFM_FUNCTION DCMGetAccessMethodInformation
  645.     ENDIF
  646.  
  647. ;
  648. ; extern OSStatus DCMGetAccessMethodFieldInfoList(DCMAccessMethodID accessMethod, ItemCount maxFieldNum, ItemCount *numOfField, DCMFieldInfoRef fieldInfo[2147483647])
  649. ;
  650.     IF GENERATINGCFM THEN
  651.         IMPORT_CFM_FUNCTION DCMGetAccessMethodFieldInfoList
  652.     ENDIF
  653.  
  654. ;
  655. ;    Operators for DCMFieldInfoRef
  656. ;
  657. ;
  658. ; extern OSStatus DCMCreateFieldInfoRef(DCMFieldInfoRef *fieldInfo)
  659. ;
  660.     IF GENERATINGCFM THEN
  661.         IMPORT_CFM_FUNCTION DCMCreateFieldInfoRef
  662.     ENDIF
  663.  
  664. ;
  665. ; extern OSStatus DCMDisposeFieldInfoRef(DCMFieldInfoRef fieldInfo)
  666. ;
  667.     IF GENERATINGCFM THEN
  668.         IMPORT_CFM_FUNCTION DCMDisposeFieldInfoRef
  669.     ENDIF
  670.  
  671. ;
  672. ; extern OSStatus DCMSetFieldInfoTagType(DCMFieldInfoRef fieldInfo, DCMFieldTag fieldTag, DCMFieldType fieldType, const DCMFieldSubType *subType)
  673. ;
  674.     IF GENERATINGCFM THEN
  675.         IMPORT_CFM_FUNCTION DCMSetFieldInfoTagType
  676.     ENDIF
  677.  
  678. ;
  679. ; extern OSStatus DCMSetFieldInfoMaxSize(DCMFieldInfoRef fieldInfo, ByteCount maximumSize)
  680. ;
  681.     IF GENERATINGCFM THEN
  682.         IMPORT_CFM_FUNCTION DCMSetFieldInfoMaxSize
  683.     ENDIF
  684.  
  685. ;
  686. ; extern OSStatus DCMSetFieldInfoAttribute(DCMFieldInfoRef fieldInfo, DCMFieldAttribute attribute)
  687. ;
  688.     IF GENERATINGCFM THEN
  689.         IMPORT_CFM_FUNCTION DCMSetFieldInfoAttribute
  690.     ENDIF
  691.  
  692. ;
  693. ; extern OSStatus DCMSetFieldInfoName(DCMFieldInfoRef fieldInfo, ItemCount numOfName, const ConstTextObject fieldName[2147483647])
  694. ;
  695.     IF GENERATINGCFM THEN
  696.         IMPORT_CFM_FUNCTION DCMSetFieldInfoName
  697.     ENDIF
  698.  
  699. ;
  700. ; extern OSStatus DCMSetFieldInfoFindType(DCMFieldInfoRef fieldInfo, ItemCount numOfType, DCMFindMethodType findMethodType[2147483647])
  701. ;
  702.     IF GENERATINGCFM THEN
  703.         IMPORT_CFM_FUNCTION DCMSetFieldInfoFindType
  704.     ENDIF
  705.  
  706. ;
  707. ; extern OSStatus DCMSetFieldInfoFindName(DCMFieldInfoRef fieldInfo, DCMFindMethodType findMethodType, ItemCount numOfName, const ConstTextObject findMethodName[2147483647])
  708. ;
  709.     IF GENERATINGCFM THEN
  710.         IMPORT_CFM_FUNCTION DCMSetFieldInfoFindName
  711.     ENDIF
  712.  
  713. ;
  714. ; extern OSStatus DCMSetFieldInfoDefaultData(DCMFieldInfoRef fieldInfo, ByteCount dataSize, ConstLogicalAddress defaultData)
  715. ;
  716.     IF GENERATINGCFM THEN
  717.         IMPORT_CFM_FUNCTION DCMSetFieldInfoDefaultData
  718.     ENDIF
  719.  
  720. ;
  721. ; extern OSStatus DCMGetFieldInfoTagType(DCMFieldInfoRef fieldInfo, DCMFieldTag *fieldTag, DCMFieldType *fieldType, DCMFieldSubType *subType)
  722. ;
  723.     IF GENERATINGCFM THEN
  724.         IMPORT_CFM_FUNCTION DCMGetFieldInfoTagType
  725.     ENDIF
  726.  
  727. ;
  728. ; extern OSStatus DCMGetFieldInfoMaxSize(DCMFieldInfoRef fieldInfo, ByteCount *maximumSize)
  729. ;
  730.     IF GENERATINGCFM THEN
  731.         IMPORT_CFM_FUNCTION DCMGetFieldInfoMaxSize
  732.     ENDIF
  733.  
  734. ;
  735. ; extern OSStatus DCMGetFieldInfoAttribute(DCMFieldInfoRef fieldInfo, DCMFieldAttribute *attribute)
  736. ;
  737.     IF GENERATINGCFM THEN
  738.         IMPORT_CFM_FUNCTION DCMGetFieldInfoAttribute
  739.     ENDIF
  740.  
  741. ;
  742. ; extern OSStatus DCMGetFieldInfoName(DCMFieldInfoRef fieldInfo, LocaleIdentifier nameLocale, TextObject fieldName)
  743. ;
  744.     IF GENERATINGCFM THEN
  745.         IMPORT_CFM_FUNCTION DCMGetFieldInfoName
  746.     ENDIF
  747.  
  748. ;
  749. ; extern OSStatus DCMGetFieldInfoNameList(DCMFieldInfoRef fieldInfo, ItemCount maxNameNum, ItemCount *numOfName, TextObject fieldName[2147483647])
  750. ;
  751.     IF GENERATINGCFM THEN
  752.         IMPORT_CFM_FUNCTION DCMGetFieldInfoNameList
  753.     ENDIF
  754.  
  755. ;
  756. ; extern OSStatus DCMGetFieldInfoFindTypeList(DCMFieldInfoRef fieldInfo, ItemCount maxMethodNum, ItemCount *numOfMethod, DCMFindMethodType findMethodType[2147483647])
  757. ;
  758.     IF GENERATINGCFM THEN
  759.         IMPORT_CFM_FUNCTION DCMGetFieldInfoFindTypeList
  760.     ENDIF
  761.  
  762. ;
  763. ; extern OSStatus DCMGetFieldInfoFindName(DCMFieldInfoRef fieldInfo, DCMFindMethodType findMethodType, LocaleIdentifier nameLocale, TextObject findMethodName)
  764. ;
  765.     IF GENERATINGCFM THEN
  766.         IMPORT_CFM_FUNCTION DCMGetFieldInfoFindName
  767.     ENDIF
  768.  
  769. ;
  770. ; extern OSStatus DCMGetFieldInfoFindNameList(DCMFieldInfoRef fieldInfo, DCMFindMethodType findMethodType, ItemCount maxNameNum, ItemCount *numOfName, TextObject findMethodName[2147483647])
  771. ;
  772.     IF GENERATINGCFM THEN
  773.         IMPORT_CFM_FUNCTION DCMGetFieldInfoFindNameList
  774.     ENDIF
  775.  
  776. ;
  777. ; extern OSStatus DCMGetFieldInfoDefaultData(DCMFieldInfoRef fieldInfo, ByteCount maxDataSize, ByteCount *actualSize, LogicalAddress defaultData)
  778. ;
  779.     IF GENERATINGCFM THEN
  780.         IMPORT_CFM_FUNCTION DCMGetFieldInfoDefaultData
  781.     ENDIF
  782.  
  783. ;
  784. ;    API for AccessMethod only
  785. ;
  786. ;
  787. ; extern OSStatus DCMAddFoundRecordToIterator(ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, DCMFieldType fieldType[2147483647], ByteCount dataSize[2147483647], ConstLogicalAddress data[2147483647], DCMFoundRecordIterator recordIterator)
  788. ;
  789.     IF GENERATINGCFM THEN
  790.         IMPORT_CFM_FUNCTION DCMAddFoundRecordToIterator
  791.     ENDIF
  792.  
  793.     ENDIF
  794. ;
  795. ;=============================================================================================
  796. ; System 7 Dictionary Manager
  797. ;=============================================================================================
  798. ;
  799.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  800.  
  801.                                                             ; Dictionary data insertion modes 
  802. kInsert                            EQU        0                    ; Only insert the input entry if there is nothing in the dictionary that matches the key. 
  803. kReplace                        EQU        1                    ; Only replace the entries which match the key with the input entry. 
  804. kInsertOrReplace                EQU        2                    ; Insert the entry if there is nothing in the dictionary which matches the key, otherwise replaces the existing matched entries with the input entry. 
  805. ;  This Was InsertMode 
  806. ; typedef short                         DictionaryDataInsertMode
  807.  
  808.  
  809.                                                             ; Key attribute constants 
  810. kIsCaseSensitive                EQU        $10                    ; case sensitive = 16        
  811. kIsNotDiacriticalSensitive        EQU        $20                    ; diac not sensitive = 32    
  812.  
  813.                                                             ; Registered attribute type constants.    
  814. kNoun                            EQU        -1
  815. kVerb                            EQU        -2
  816. kAdjective                        EQU        -3
  817. kAdverb                            EQU        -4
  818. ;  This Was AttributeType 
  819. ; typedef SInt8                         DictionaryEntryAttribute
  820.  
  821. ;  Dictionary information record 
  822. DictionaryInformation    RECORD 0
  823. dictionaryFSSpec         ds        FSSpec            ; offset: $0 (0)
  824. numberOfRecords             ds.l    1                ; offset: $46 (70)
  825. currentGarbageSize         ds.l    1                ; offset: $4A (74)
  826. script                     ds.w    1                ; offset: $4E (78)
  827. maximumKeyLength         ds.w    1                ; offset: $50 (80)
  828. keyAttributes             ds.b    1                ; offset: $52 (82)
  829.                          ORG 84
  830. sizeof                     EQU *                    ; size:   $54 (84)
  831.                         ENDR
  832. DictionaryAttributeTable RECORD 0
  833. datSize                     ds.b    1                ; offset: $0 (0)
  834. datTable                 ds.b    1                ; offset: $1 (1) <-- really an array of length one
  835. sizeof                     EQU *                    ; size:   $2 (2)
  836.                         ENDR
  837. ; typedef struct DictionaryAttributeTable * DictionaryAttributeTablePtr
  838.  
  839. ;
  840. ; pascal OSErr InitializeDictionary(const FSSpec *theFsspecPtr, SInt16 maximumKeyLength, SInt8 keyAttributes, ScriptCode script)
  841. ;
  842.     IF ¨ GENERATINGCFM THEN
  843.         Macro
  844.         _InitializeDictionary
  845.             move.w              #$0500,D0
  846.             dc.w                $AA53
  847.         EndM
  848.     ELSE
  849.         IMPORT_CFM_FUNCTION InitializeDictionary
  850.     ENDIF
  851.  
  852. ;
  853. ; pascal OSErr OpenDictionary(const FSSpec *theFsspecPtr, SInt8 accessPermission, SInt32 *dictionaryReference)
  854. ;
  855.     IF ¨ GENERATINGCFM THEN
  856.         Macro
  857.         _OpenDictionary
  858.             move.w              #$0501,D0
  859.             dc.w                $AA53
  860.         EndM
  861.     ELSE
  862.         IMPORT_CFM_FUNCTION OpenDictionary
  863.     ENDIF
  864.  
  865. ;
  866. ; pascal OSErr CloseDictionary(SInt32 dictionaryReference)
  867. ;
  868.     IF ¨ GENERATINGCFM THEN
  869.         Macro
  870.         _CloseDictionary
  871.             move.w              #$0202,D0
  872.             dc.w                $AA53
  873.         EndM
  874.     ELSE
  875.         IMPORT_CFM_FUNCTION CloseDictionary
  876.     ENDIF
  877.  
  878. ;
  879. ; pascal OSErr InsertRecordToDictionary(SInt32 dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
  880. ;
  881.     IF ¨ GENERATINGCFM THEN
  882.         Macro
  883.         _InsertRecordToDictionary
  884.             move.w              #$0703,D0
  885.             dc.w                $AA53
  886.         EndM
  887.     ELSE
  888.         IMPORT_CFM_FUNCTION InsertRecordToDictionary
  889.     ENDIF
  890.  
  891. ;
  892. ; pascal OSErr DeleteRecordFromDictionary(SInt32 dictionaryReference, ConstStr255Param key)
  893. ;
  894.     IF ¨ GENERATINGCFM THEN
  895.         Macro
  896.         _DeleteRecordFromDictionary
  897.             move.w              #$0404,D0
  898.             dc.w                $AA53
  899.         EndM
  900.     ELSE
  901.         IMPORT_CFM_FUNCTION DeleteRecordFromDictionary
  902.     ENDIF
  903.  
  904. ;
  905. ; pascal OSErr FindRecordInDictionary(SInt32 dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
  906. ;
  907.     IF ¨ GENERATINGCFM THEN
  908.         Macro
  909.         _FindRecordInDictionary
  910.             move.w              #$0805,D0
  911.             dc.w                $AA53
  912.         EndM
  913.     ELSE
  914.         IMPORT_CFM_FUNCTION FindRecordInDictionary
  915.     ENDIF
  916.  
  917. ;
  918. ; pascal OSErr FindRecordByIndexInDictionary(SInt32 dictionaryReference, SInt32 recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
  919. ;
  920.     IF ¨ GENERATINGCFM THEN
  921.         Macro
  922.         _FindRecordByIndexInDictionary
  923.             move.w              #$0A06,D0
  924.             dc.w                $AA53
  925.         EndM
  926.     ELSE
  927.         IMPORT_CFM_FUNCTION FindRecordByIndexInDictionary
  928.     ENDIF
  929.  
  930. ;
  931. ; pascal OSErr GetDictionaryInformation(SInt32 dictionaryReference, DictionaryInformation *theDictionaryInformation)
  932. ;
  933.     IF ¨ GENERATINGCFM THEN
  934.         Macro
  935.         _GetDictionaryInformation
  936.             move.w              #$0407,D0
  937.             dc.w                $AA53
  938.         EndM
  939.     ELSE
  940.         IMPORT_CFM_FUNCTION GetDictionaryInformation
  941.     ENDIF
  942.  
  943. ;
  944. ; pascal OSErr CompactDictionary(SInt32 dictionaryReference)
  945. ;
  946.     IF ¨ GENERATINGCFM THEN
  947.         Macro
  948.         _CompactDictionary
  949.             move.w              #$0208,D0
  950.             dc.w                $AA53
  951.         EndM
  952.     ELSE
  953.         IMPORT_CFM_FUNCTION CompactDictionary
  954.     ENDIF
  955.  
  956.     ENDIF
  957.     ENDIF ; __DICTIONARY__ 
  958.  
  959.